package persistence.appeloffre;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import persistence.utilisateur.Fournisseur;

@Entity
@Table(name = "REPONSE_APPEL_OFFRE")
public class ReponseAppelOffre {

	private int id;
	
	private double prix;
	
	private Date date;
	
	private int validation; 
	
	private AppelOffre ao;
	
	private Fournisseur fournisseur;

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name="REPONSE_APPEL_OFFRE_ID")
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name="PRIX", nullable=false)
	public double getPrix() {
		return prix;
	}

	public void setPrix(double prix) {
		this.prix = prix;
	}

	@Column(name="DATE", nullable=false)
	@Temporal(value=TemporalType.DATE)
	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@OneToOne
	@JoinColumn(name="APPEL_OFFRE_ID")
	public AppelOffre getAo() {
		return ao;
	}

	public void setAo(AppelOffre ao) {
		this.ao = ao;
	}

	@Column(name="VALIDATION", nullable=false)
	public int getValidation() {
		return validation;
	}

	public void setValidation(int validation) {
		this.validation = validation;
	}

	@OneToOne
	@JoinColumn(name="FOURNISSEUR_ID")
	public Fournisseur getFournisseur() {
		return fournisseur;
	}

	public void setFournisseur(Fournisseur fournisseur) {
		this.fournisseur = fournisseur;
	}
}
